//package com.wyz.web.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.jdbc.datasource.DataSourceTransactionManager;
//import org.springframework.transaction.TransactionDefinition;
//import org.springframework.transaction.support.TransactionTemplate;
//
//import javax.sql.DataSource;
//
//@Configuration
//public class TxConfig {
//
//    @Bean
//    public DataSourceTransactionManager transactionManager(DataSource ds2){
//        return new DataSourceTransactionManager(ds2);
//    }
//
//
//
//    @Bean
//    public TransactionTemplate transactionTemplate(DataSourceTransactionManager transactionManager){
//        TransactionTemplate template = new TransactionTemplate(transactionManager);
//        template.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
//        template.setIsolationLevel(TransactionDefinition.ISOLATION_REPEATABLE_READ);
//        return template;
//    }
//
//
//}
